package com.monitor.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.monitor.entity.ErpSaleRepairOrder;

/**
 * <p>
 * 销售维修表 Mapper 接口
 * </p>
 *
 * @author LX
 * @since 2018-09-12
 */
public interface ErpSaleRepairOrderMapper extends BaseMapper<ErpSaleRepairOrder> {
	@Select("select sro.id from erp_sale_repair_order sro where sro.customer_id = #{custId} and sro.sale_repair_date >=#{stratTime} and sro.sale_repair_date<#{endTime}")
	public List<Integer> selectByCustomerName(@Param("custId")Integer custId,@Param("stratTime")String stratTime,@Param("endTime")String endTime);
	
	@Select("SELECT * from erp_sale_repair_order sro where sro.customer_id = #{custId} and sro.sale_repair_date >=#{stratTime}  and sro.sale_repair_date<=#{endTime} and sro.customer_name =#{custName} and sro.sale_repair_payment_method != '免费'")
	public List<ErpSaleRepairOrder> selectBySroIds(@Param("custId")Integer custId,@Param("stratTime")String stratTime,@Param("endTime")String endTime,@Param("custName")String custName);
	
	@Select("SELECT * from erp_sale_repair_order s where s.customer_id = #{custId} and s.sale_repair_date >= #{stratTime} and s.sale_repair_date <=#{endTime}")
	public List<ErpSaleRepairOrder> selectByCustId(@Param("custId")Integer custId,@Param("stratTime")String stratTime,@Param("endTime")String endTime);
}
